package com.caesar.Collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Predicate;

/**
 * @author caesar
 * @date 2025/7/16
 * @Description:
 * @apiNote
 */
public class TestCollection1 {
    public static void main(String[] args) {
        Collection< String> c = new ArrayList<>();
        c.add("hello");
        c.add("hello");
        c.add("java");
        c.add("world");
        c.add("atguigu");
        c.add("love");
        c.add("you");
        c.add("mom");
        c.add("dad");
        c.add("noon");
        System.out.println( c);

        Predicate<String> p = new Predicate<>() {
            @Override
            public boolean test(String o) {
                return new StringBuilder(o).reverse().toString().equals(o);
            }
        };
        c.removeIf(p);
        System.out.println(c);

    }
}
